{% load static %}
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>投票结果 - {{ question.question_text }}</title>
    <link rel="stylesheet" href="{% static 'polls/style.css' %}">
    <style>
        :root {
            --primary-color: #4361ee;
            --secondary-color: #3f37c9;
            --accent-color: #4895ef;
            --danger-color: #f72585;
            --light-color: #f8f9fa;
            --dark-color: #212529;
            --success-color: #4cc9f0;
            --border-radius: 12px;
            --box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
            --transition: all 0.3s ease;
        }
        
        body {
            font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
            background: linear-gradient(135deg, #f5f7fa 0%, #e4e8f0 100%);
            color: var(--dark-color);
            line-height: 1.6;
            margin: 0;
            padding: 2rem 0;
            min-height: 100vh;
        }
        
        .container {
            max-width: 800px;
            margin: 0 auto;
            padding: 0 1.5rem;
        }
        
        .result-card {
            background: white;
            border-radius: var(--border-radius);
            box-shadow: var(--box-shadow);
            padding: 2.5rem;
            margin-bottom: 2rem;
            transition: var(--transition);
            border: 1px solid rgba(255, 255, 255, 0.2);
        }
        
        .result-card:hover {
            transform: translateY(-5px);
            box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
        }
        
        .result-title {
            color: var(--secondary-color);
            font-size: 2rem;
            text-align: center;
            margin-bottom: 2rem;
            padding-bottom: 1.5rem;
            border-bottom: 2px solid #eee;
            font-weight: 600;
            position: relative;
        }
        
        .result-title::after {
            content: '';
            position: absolute;
            bottom: -2px;
            left: 50%;
            transform: translateX(-50%);
            width: 80px;
            height: 3px;
            background: var(--accent-color);
            border-radius: 3px;
        }
        
        .result-list {
            list-style: none;
            padding: 0;
            margin: 0;
        }
        
        .result-item {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 1.25rem 0;
            border-bottom: 1px solid #eee;
            transition: var(--transition);
        }
        
        .result-item:hover {
            background-color: rgba(67, 97, 238, 0.05);
            transform: scale(1.01);
            padding-left: 10px;
            border-radius: 6px;
        }
        
        .result-item:last-child {
            border-bottom: none;
        }
        
        .choice-text {
            flex: 1;
            font-size: 1.15rem;
            font-weight: 500;
            color: var(--dark-color);
        }
        
        .vote-count {
            background: var(--primary-color);
            color: white;
            padding: 0.5rem 1rem;
            border-radius: 50px;
            font-size: 1rem;
            min-width: 70px;
            text-align: center;
            font-weight: 600;
            box-shadow: 0 4px 8px rgba(67, 97, 238, 0.2);
            transition: var(--transition);
        }
        
        .result-item:hover .vote-count {
            background: var(--secondary-color);
            transform: scale(1.05);
        }
        
        .navigation {
            display: flex;
            justify-content: space-between;
            margin-top: 3rem;
            gap: 1.5rem;
        }
        
        .nav-button {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            padding: 0.9rem 2rem;
            border-radius: 50px;
            text-decoration: none;
            transition: var(--transition);
            font-weight: 500;
            flex: 1;
            border: none;
            cursor: pointer;
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
        }
        
        .home-button {
            background: var(--dark-color);
            color: white;
        }
        
        .home-button:hover {
            background: #343a40;
            transform: translateY(-2px);
            box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
        }
        
        .back-button {
            background: var(--danger-color);
            color: white;
        }
        
        .back-button:hover {
            background: #e3176a;
            transform: translateY(-2px);
            box-shadow: 0 6px 12px rgba(247, 37, 133, 0.3);
        }

        /* 动画效果 */
        @keyframes fadeIn {
            from { opacity: 0; transform: translateY(20px); }
            to { opacity: 1; transform: translateY(0); }
        }

        .result-card {
            animation: fadeIn 0.6s ease-out forwards;
        }

        .result-item {
            opacity: 0;
            animation: fadeIn 0.5s ease-out forwards;
            animation-delay: calc(var(--i) * 0.1s);
        }
        
        /* 响应式设计 */
        @media (max-width: 768px) {
            .container {
                padding: 0 1rem;
            }
            
            .result-card {
                padding: 1.5rem;
            }
            
            .result-title {
                font-size: 1.6rem;
            }
            
            .navigation {
                flex-direction: column;
                gap: 1rem;
            }
            
            .nav-button {
                width: 100%;
            }
        }

        @media (max-width: 480px) {
            body {
                padding: 1rem 0;
            }
            
            .result-card {
                padding: 1.25rem;
            }
            
            .result-title {
                font-size: 1.4rem;
                margin-bottom: 1.5rem;
            }
            
            .choice-text {
                font-size: 1rem;
            }
            
            .vote-count {
                font-size: 0.9rem;
                padding: 0.4rem 0.8rem;
                min-width: 60px;
            }
        }
    </style>
</head>
<body>
    <div class="container">
        <div class="result-card">
            <h1 class="result-title">{{ question.question_text }}</h1>
            
            <ul class="result-list">
                {% for choice in question.choice_set.all %}
                <li class="result-item" style="--i: {{ forloop.counter }}">
                    <span class="choice-text">{{ choice.choice_text }}</span>
                    <span class="vote-count">{{ choice.votes }} vote{{ choice.votes|pluralize }}</span>
                </li>
                {% endfor %}
            </ul>
            
            <div class="navigation">
                <a href="{% url 'polls:index' %}" class="nav-button home-button">返回首页</a>
                <a href="{% url 'polls:detail' question.id %}" class="nav-button back-button">重新投票</a>
            </div>
        </div>
    </div>
</body>
</html>